package com.weixing.mall.provider.api.service;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.provider.api.fallback.OrderServiceFallback;
import com.weixing.mall.provider.api.model.dto.AfterOrderImgDto;
import com.weixing.mall.provider.api.model.dto.OrderSettleDto;
import com.weixing.mall.provider.api.model.dto.SeckillOrderDto;
import com.weixing.mall.provider.api.model.dto.SeckillOrderImportDto;
import com.weixing.mall.provider.api.model.enums.OrderTypeEnum;
import com.weixing.mall.provider.api.model.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.ribbon.FeignRibbonClientAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author wx
 * @Date 2019/11/28 11:46
 * @Version 1.0
 */
@FeignClient(value = "mall-provider-order", configuration = FeignRibbonClientAutoConfiguration.class, fallback = OrderServiceFallback.class)
public interface OrderServiceRpc {
    @GetMapping("api/order/selectByAgentSn")
    OrderTypeEnum selectByAgentSn(@RequestParam(value = "orderSn", required = false) String orderSn);

    @GetMapping("api/order/sealingSheetOrderList")
    List<SealingSheetOrderVo> sealingSheetOrderList();

    @GetMapping("api/order/updateStatus")
    Result updateStatus(@RequestParam(value = "id", required = false) Long id, @RequestParam(value = "id", required = false) Integer status);

    @GetMapping("api/order/selectById")
    Result<OrderItemVo> selectById(@RequestParam(value = "id", required = false) Long id);

    @PostMapping("api/order/saveAfterOrderImg")
    Result   saveAfterOrderImg(@RequestBody AfterOrderImgDto afterOrderImgDto);

    @GetMapping("api/order/getCountfrontOrder")
    int getCountfrontOrder(@RequestParam(value = "memberId", required = false) Long memberId, @RequestParam(value = "frontOrderStatus", required = false) Integer frontOrderStatus);

    @GetMapping("api/order/byDepotId")
    List<TransferListVo> byDepotId(@RequestParam(value = "depotId", required = false) Long depotId);

    @GetMapping("api/order/updateOrderStatus")
    Result updateOrderStatusS(@RequestParam(value = "depotId", required = false) Integer depotId);

    @PostMapping("api/order/settle/notify")
    Result orderSettleNotify(@RequestParam(value = "orderId") Long orderId);

    @GetMapping("api/order/updateAfterSaleStatus")
    Result updateAfterSaleStatus(@RequestParam(value = "id", required = false) Long id, @RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "operatorId", required = false) Long operatorId, @RequestParam(value = "operatorName", required = false) String operatorName);

    @GetMapping("api/order/updateDepotInfo")
    Result updateDepotInfo(@RequestParam(value = "id") Long id,
                           @RequestParam(value = "depotSn", required = false)String depotSn,
                           @RequestParam(value = "depotLocation", required = false)String depotLocation,
                           @RequestParam(value = "depotOrder", required = false)String depotOrder);

    @GetMapping("api/order/selectAgentActOrdersByActId")
    Result<List<ActOrderSettleVo>> selectAgentActOrdersByActId(@RequestParam(value = "actId") Long actId);

    @PostMapping("api/order/executeSeckillOrderImport")
    Result executeSeckillOrderImport(@RequestBody SeckillOrderDto seckillOrderDto);

    @PostMapping("api/order/actOrderSettleNotify")
    Result actOrderSettleNotify(@RequestBody List<Long> orderIds);

    @GetMapping("api/order/getOrderGoodById")
    OrderGoodItvmVo getOrderGoodById(@RequestParam(value = "orderId") Long orderId);

    @GetMapping("api/order/getAllAgentIdOfToAuditOder")
    Result<List<Long>> executeAuditOrderTask();

    @GetMapping("api/order/autoConfirmOrder")
    Result autoConfirmOrder();

    @PostMapping("api/order/cancelOrder")
    Result cancelOrder(@RequestParam(value = "orderId") long orderId);

    @GetMapping("api/order/checkHasAuditOrder")
    Result checkHasAuditOrder(@RequestParam(value = "agentId") long agentId);

    @GetMapping("api/order/updateTag")
    Result updateTag(@RequestParam(value = "orderId") Long orderId, @RequestParam(value = "sysTag") Integer sysTag, @RequestParam(value = "appTag") Integer appTag);

    @GetMapping("api/order/getAgentRuleData")
    Result getAgentRuleData(@RequestParam(value = "agentId") Long agentId, @RequestParam(value = "startTime") String startTime, @RequestParam(value = "endTime") String endTime);

    @GetMapping("api/order/checkMemberOrderByMemberId")
    Result<Integer> checkMemberOrderByMemberId(@RequestParam(value = "memberId") long memberId);

    @PostMapping("api/order/executeSeckillOrderImport4kefu")
    Result executeSeckillOrderImport4kefu(@RequestBody SeckillOrderDto orderDto);
}
